package day2.demo2.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
@RestController
@RequestMapping("/user")
public class UserCtrl {
    @GetMapping("/login")
    public boolean login(String username, String pass, HttpSession session){
        if("admin".equals(username)&&"123".equals(pass)){
            session.setAttribute("username",username);
            return true;
        }else {
            return false;
        }
    }
}